<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8">

    <meta content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">

    <meta content="yes" name="apple-mobile-web-app-capable">

    <meta content="black" name="apple-mobile-web-app-status-bar-style">

    <meta content="telephone=no" name="format-detection">

    <meta content="email=no" name="format-detection">

    <link rel="stylesheet" href="__PUBLIC__/Wx/css/pay.css">

    <link rel="stylesheet" href="__PUBLIC__/Wx/css/keyboard.css">

    <title>向商户付款</title>

</head>

<body ontouchstart class="weui-wepay-pay-wrap">

<div class="pay-top">

    <div class="logo">

        <h2><img src="__PUBLIC__/Wx/images/logo04.png"/></h2>

        <h3 id="storename">{$storeInfo.storename}</h3>

    </div>

    <div class="pay-input-money">

        <div class="input-left">

            <span>输入消费金额</span>

        </div>

        <div class="input-right">

            <span>￥</span>

            <label id="paymoney" type="text"></label>

        </div>

    </div>

    <div class="note">

        <i></i><p>微信支付送积分，积分限时在店兑换果蔬、在乡土味士兑换扶农品牌礼品</p><p>关注乡土味士后获取支付积分</p>

    </div>

    <div class="js">由<b>乡土味士</b>提供技术支持</div>

</div>

<div class="payinfo">

    <table cellspacing="0" cellpadding="0">

        <tr>

            <td class="paynum">1</td>

            <td class="paynum">2</td>

            <td class="paynum">3</td>

            <td id="pay-return">

                <div class="keybord-return"></div>

            </td>

        </tr>

        <tr>

            <td class="paynum">4</td>

            <td class="paynum">5</td>

            <td class="paynum">6</td>

            <td rowspan="3" class="pay">

                <a href="javascript:return false;">

                    <div class="a-pay">

                        <p>支付</p>

                    </div>

                </a>

            </td>

        </tr>

        <tr>

            <td class="paynum">7</td>

            <td class="paynum">8</td>

            <td class="paynum">9</td>

        </tr>

        <tr>

            <td id="pay-zero" colspan="2" class="payzero">0</td>

            <td id="pay-float">.</td>

        </tr>

    </table>

</div>



<form action="<?=U('PayLog/toPay')?>" class="js_form" method="post">

    <!--店铺老板的id、店铺id-->

    <input type="hidden" name="u_id" value="{$storeInfo.u_id}" class="form-control">

    <input type="hidden" name="storename" value="{$storeInfo.storename}" class="form-control">

    <input type="hidden" name="storename" value="{$storeInfo.storename}" class="form-control">

    <input type="hidden" name="storename" value="{$storeInfo.storename}" class="form-control">

    <input type="hidden" name="amount" class="form-control">

</form>



</body>

    <script src="__PUBLIC__/Wx/js/jquery.js" ></script>

    <script src="__PUBLIC__/js/layer/layer.js"></script>



    <script type="text/javascript">

        $(function(){

            $(".payinfo").slideDown();

            var $paymoney = $("#paymoney");

            // 大写金额

            var upperCaseMoney = $('.upper-case span');

            $("#paymoney").focus(function(){

                $(".payinfo").slideDown();

                document.activeElement.blur();

            });

            $(".paynum").each(function(){

                $(this).click(function(){

                    if(($paymoney.text()).indexOf(".") != -1 && ($paymoney.text()).substring(($paymoney.text()).indexOf(".") + 1, ($paymoney.text()).length).length == 2){

                        return;

                    }

                    if($.trim($paymoney.text()) == "0"){

                        return;

                    }

                    if (parseInt($paymoney.text()) > 10000 && $paymoney.text().indexOf(".") == -1) {

                        return;

                    }

                    $('.pay').removeClass('pay-disabled').find('a').attr('href','javascript:sub();');

                    $paymoney.text($paymoney.text() + $(this).text());

                });

            });



            $("#pay-return").click(function(){

                $paymoney.text(($paymoney.text()).substring(0, ($paymoney.text()).length - 1));

                if (!$paymoney.text()) {

                    upperCaseMoney.text('');

                    $('.pay').addClass('pay-disabled').find('a').attr('href', 'javascript:return false;');

                }

            });



            $("#pay-zero").click(function(){

                if(($paymoney.text()).indexOf(".") != -1 && ($paymoney.text()).substring(($paymoney.text()).indexOf(".") + 1, ($paymoney.text()).length).length == 2){

                    return;

                }

                if($.trim($paymoney.text()) == "0"){

                    return;

                }

                if (parseInt($paymoney.text()) > 10000 && $paymoney.text().indexOf(".") == -1) {

                    return;

                }

                $paymoney.text($paymoney.text() + $(this).text());

            });



            $("#pay-float").click(function(){

                if($.trim($paymoney.text()) == ""){

                    return;

                }



                if(($paymoney.text()).indexOf(".") != -1){

                    return;

                }



                if(($paymoney.text()).indexOf(".") != -1){

                    return;

                }



                $paymoney.text($paymoney.text() + $(this).text());

            });

            if (!$paymoney.text()) {

                $('.pay').addClass('pay-disabled');

            }

        });



        function sub () {

            var amount = $("#paymoney").text();

            if(amount!=''){

                $("input[name='amount']").val(amount);

                $(".js_form").submit();

            }



        };

    </script>

    <!--自适应布局-->

    <script>

        (function () {

            var designW = 750;  //设计稿宽

            var font_rate = 100;

            //适配

            document.getElementsByTagName("html")[0].style.fontSize = document.body.offsetWidth / designW * font_rate + "px";

            document.getElementsByTagName("body")[0].style.fontSize = document.body.offsetWidth / designW * font_rate + "px";



            //监测窗口大小变化

            window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function () {

                document.getElementsByTagName("html")[0].style.fontSize = document.body.offsetWidth / designW * font_rate + "px";

                document.getElementsByTagName("body")[0].style.fontSize = document.body.offsetWidth / designW * font_rate + "px";

            }, false);

        })();

    </script>



    </html>









